SlkStore.ValidatePackage Method

Validates a specified version of a given e-learning package (that's stored in a SharePoint document library), and returns its content warnings. If that version -- with the same last-modified date/time -- is already registered, its information is returned rather than re-validating the package. Uses an MLC SharePoint location string to locate the package.

Parent Type: SlkStore

Namespace: Microsoft.SharePointLearningKit

Assembly: Microsoft.SharePointLearningKit.dll

Syntax
C#

public LearningStoreXml ValidatePackage (
string location

)

Parameters

location

The MLC SharePoint location string that refers to the e-learning package to validate. Use SharePointPackageStore.GetLocation to construct this string.

Return Value

The warnings. This XML consists of a root "<Warnings>" element containing one "<Warning>" element per warning, each of which contains the text of the warning as the content of the element plus the following attributes: the "Code" attribute contains the warning's ValidationResultCode, and the "Type" attribute contains the warning's type, either "Error" or "Warning". null is returned if there are no warnings.

Exceptions
Exception type Condition
FileNotFoundException

location refers to a file that does not exist.

SafeToDisplayException

An error occurred that can be displayed to a browser user. Possible cause: the package has problems severe enough to prevent it from being assignable within SharePoint Learning Kit.

UnauthorizedAccessException

location refers to a file that the user does not have access to.

Remarks

If the package is valid, null is returned. If the package is not completely valid, but is valid enough to be assigned within SharePoint Learning Kit, warnings about the package are returned. If the package has problems severe enough to prevent it from being assignable within SLK, a SafeToDisplayException is thrown.

Security:  This operation fails if the current user doesn't have access to the package.